package wiz.exch.activity;

import java.util.ArrayList;
import wiz.exch.util.ContentBean;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class WizListAdapter extends BaseAdapter{
	
	private Context context;
	private LayoutInflater mInflater;
	private ArrayList<ContentBean> arSrc;
	
	public WizListAdapter(Context context, ArrayList<ContentBean> arSrc)
	{
		this.context = context;
		//mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		this.arSrc = arSrc; 
	}
	
	public int getCount() 
	{
		// TODO Auto-generated method stub
		
		return this.arSrc.size();
	}

	public Object getItem(int position) 
	{
		// TODO Auto-generated method stub
		return this.arSrc.get(position);
	}

	public long getItemId(int position) 
	{
		// TODO Auto-generated method stub
		if(this.arSrc.size() < 1)
		{
			return -1;
		}
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) 
	{
		View v = convertView;
		if(v == null)
		{
			mInflater = LayoutInflater.from(this.context);
			v = mInflater.inflate(R.layout.listlayout, null);
		}
		
		String value = arSrc.get(position).getTitle();
		if(value != null)
		{
			//TextView tv = (TextView)v.findViewById(R.id.wizlist_sub_textview);
			//tv.setText(value);

		}
		return v;
	}

}
